package org.jeecg.modules.demo.levelset.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.levelset.entity.LevelSet;
import org.jeecg.modules.demo.levelset.mapper.LevelSetMapper;
import org.jeecg.modules.demo.levelset.service.ILevelSetService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Description: 会员等级设置
 * @Author: jeecg-boot
 * @Date: 2021-12-31
 * @Version: V1.0
 */
@Service
public class LevelSetServiceImpl extends ServiceImpl<LevelSetMapper, LevelSet> implements ILevelSetService {
    @Resource
    private LevelSetMapper levelSetMapper;

    // 查询会员等级
    @Override
    public IPage<LevelSet> searchLevelSet(Page<LevelSet> page, String rankName, String storeId) {
        return levelSetMapper.searchLevelSet(page, rankName, storeId);
    }

    //根据编号查询会员等级数量
    public Integer getCountByNum(String storeId, String rankNum) {
        return levelSetMapper.getCountByNum(storeId, rankNum);
    }

    @Override
    public void updateMemberNum() {
        levelSetMapper.updateMemberNum();
    }
}
